/* o */
import { defineStore } from "pinia";

const useFlowStore = defineStore("order", {
  state: () => {
    return {
      tableId: "",
      isTried: false,
      promoterDrawer: false,
      promoterConfig1: {},
      flowPermission1: {},
      approverDrawer: false,
      approverConfig1: {},
      copyerDrawer: false,
      copyerConfig1: {},
      conditionDrawer: false,
      conditionsConfig1: {
        conditionNodes: [],
      },
    };
  },

  actions: {
    setTableId(payload: any) {
      this.tableId = payload;
    },
    setIsTried(payload: any) {
      this.isTried = payload;
    },
    setPromoter(payload: any) {
      this.promoterDrawer = payload;
    },
    setPromoterConfig(payload: any) {
      this.promoterConfig1 = payload;
    },
    setFlowPermission(payload: any) {
      this.flowPermission1 = payload;
    },
    setApprover(payload: any) {
      this.approverDrawer = payload;
    },
    setApproverConfig(payload: any) {
      this.approverConfig1 = payload;
    },
    setCopyer(payload: any) {
      this.copyerDrawer = payload;
    },
    setCopyerConfig(payload: any) {
      this.copyerConfig1 = payload;
    },
    setCondition(payload: any) {
      this.conditionDrawer = payload;
    },
    setConditionsConfig(payload: any) {
      this.conditionsConfig1 = payload;
    },
  },
});

export default useFlowStore;
